package edu.fdzc.learn.config;

import edu.fdzc.learn.interception.LoginInterception;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebCongig implements WebMvcConfigurer {

    @Autowired
    private LoginInterception loginInterception;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterception)
                .excludePathPatterns(
                        "/auth/login",
                        "/auth/register"
                );
    }
}
